#!/usr/bin/ruby
#

require 'mysql'
require 'net/http'
require 'date'
require 'aws.rb'

id = ARGV.shift

Net::HTTP.start(AWS_URL, 80) do |http|
  request =
    AWS_PATH + '?' +
    'Service=AWSECommerceService&' +
    "AWSAccessKeyId=#{AWS_ACCESS_KEY_ID}&" +
    "Version=#{AWS_VERSION}&" +
    "Operation=ItemLookup&" +
    "ItemId=#{id}&" +
    "ResponseGroup=ItemAttributes,BrowseNodes,Similarities,SalesRank"
  res = http.get(request)
  puts res.body
end
